package cn.tedu.myweb.mapper;


import cn.tedu.myweb.entity.File;
import org.apache.ibatis.annotations.*;

@Mapper
public interface FileMapper {

    @Delete("delete from file where fid=#{id}")
    void del(int id);

    @Insert("insert into file values(null,#{rid},#{ffid},#{did},#{uid},#{fname},#{suffix},#{type},#{size},#{status},null,null)")
    void add(File f);



    @Select("select rid from file where fid=#{id}")
    File selectRidByFid(int id);

    @Update("update file set status=#{status} where fid=#{fid}")
    void changeStatus(int status, int fid);

    @Delete("delete from file where rid=#{rid}")
    void delAllByRid(Integer rid);
}
